//------------------------------------------------------------------------------
// <copyright file="HeroesCollectionDataAccess.cs" company="Damian Antonowicz">
//       copyright © 2010 Damian Antonowicz
// </copyright>
// <author>Damian Antonowicz</author>
// <email>poczta@damianantonowicz.pl</email>
//------------------------------------------------------------------------------

using System.IO;
using DotBeer.Business.Entities;
using DAnton.Utilities.Helpers;

namespace DotBeer.Data
{
    public class HeroesCollectionDataAccess : AbstractDataAccess<HeroesCollection>
    {
        #region constructors

        public HeroesCollectionDataAccess()
        {
            this.cacheData = true;
        }

        #endregion

        #region private methods

        protected override string GetSchemaPath()
        {
            return "DotBeer.Data.Schemas.HeroesSchema.xsd";
        }

        protected override string GetFilePath(params object[] list)
        {
            return Path.Combine(IOHelper.ApplicationStartupPath, @"Data\Heroes.xml");
        }

        protected override void BeforeSave(HeroesCollection coll)
        {
            RequiredFolders.CreateDataDirectory();
        }

        #endregion
    }
}
